package com.itheima.stock.mapper;

import com.itheima.stock.pojo.domain.Stock4EvrDayDomain;
import com.itheima.stock.pojo.domain.Stock4MinuteDomain;
import com.itheima.stock.pojo.domain.StockUpdownDomain;
import com.itheima.stock.pojo.entity.StockRtInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author 85190
* @description 针对表【stock_rt_info(个股详情信息表)】的数据库操作Mapper
* @createDate 2023-01-06 11:41:14
* @Entity com.itheima.stock.pojo.entity.StockRtInfo
*/
public interface StockRtInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockRtInfo record);

    int insertSelective(StockRtInfo record);

    StockRtInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockRtInfo record);

    int updateByPrimaryKey(StockRtInfo record);

    List<StockUpdownDomain> getNewestStockInfo(@Param("timePoint") Date curDate);

    // 在Mybatis中如果有多个参数,必须给参数设置别名
    List<Map> getStockUpdownCount(@Param("openTime") Date openTime,
                                  @Param("curTime") Date curTime,
                                  @Param("flag") int i);

    List<Map> getStockUpDownSectionByTime(@Param("avlDate") Date curDate);

    List<Stock4MinuteDomain> getStockInfoByCodeAndDate(
            @Param("code") String code,
            @Param("startTime") Date startTime,
            @Param("endTime") Date endTime);

    List<Stock4EvrDayDomain> getStockInfo4EvrDay(
            @Param("code") String code,
            @Param("startTime") Date startTime,
            @Param("endTime") Date endTime);

    int insertBatch(List<StockRtInfo> list);

}
